import 'package:guochaoapp/model/usersuid_entity.dart';

usersuidEntityFromJson(UsersuidEntity data, Map<String, dynamic> json) {
	if (json['success'] != null) {
		data.success = json['success'];
	}
	if (json['msg'] != null) {
		data.msg = json['msg'].toString();
	}
	if (json['code'] != null) {
		data.code = json['code'] is String
				? int.tryParse(json['code'])
				: json['code'].toInt();
	}
	if (json['data'] != null) {
		data.data = new UsersuidData().fromJson(json['data']);
	}
	if (json['sign'] != null) {
		data.sign = json['sign'];
	}
	return data;
}

Map<String, dynamic> usersuidEntityToJson(UsersuidEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['success'] = entity.success;
	data['msg'] = entity.msg;
	data['code'] = entity.code;
	if (entity.data != null) {
		data['data'] = entity.data.toJson();
	}
	data['sign'] = entity.sign;
	return data;
}

usersuidDataFromJson(UsersuidData data, Map<String, dynamic> json) {
	if (json['uid'] != null) {
		data.uid = json['uid'].toString();
	}
	if (json['phone'] != null) {
		data.phone = json['phone'].toString();
	}
	if (json['level'] != null) {
		data.level = json['level'] is String
				? int.tryParse(json['level'])
				: json['level'].toInt();
	}
	if (json['balance'] != null) {
		data.balance = json['balance'] is String
				? double.tryParse(json['balance'])
				: json['balance'].toDouble();
	}
	if (json['account'] != null) {
		data.account = json['account'].toString();
	}
	if (json['openCredit'] != null) {
		data.openCredit = json['openCredit'];
	}
	if (json['currentBillAmount'] != null) {
		data.currentBillAmount = json['currentBillAmount'] is String
				? int.tryParse(json['currentBillAmount'])
				: json['currentBillAmount'].toInt();
	}
	if (json['payingBillAmount'] != null) {
		data.payingBillAmount = json['payingBillAmount'] is String
				? int.tryParse(json['payingBillAmount'])
				: json['payingBillAmount'].toInt();
	}
	if (json['repayDeadline'] != null) {
		data.repayDeadline = json['repayDeadline'].toString();
	}
	if (json['hasOutBill'] != null) {
		data.hasOutBill = json['hasOutBill'];
	}
	return data;
}

Map<String, dynamic> usersuidDataToJson(UsersuidData entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['uid'] = entity.uid;
	data['phone'] = entity.phone;
	data['level'] = entity.level;
	data['balance'] = entity.balance;
	data['account'] = entity.account;
	data['openCredit'] = entity.openCredit;
	data['currentBillAmount'] = entity.currentBillAmount;
	data['payingBillAmount'] = entity.payingBillAmount;
	data['repayDeadline'] = entity.repayDeadline;
	data['hasOutBill'] = entity.hasOutBill;
	return data;
}